-
Notifications
You must be signed in to change notification settings - Fork 22
Match plugin text/axis/icon colours to the napari theme. #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match plugin text/axis/icon colours to the napari theme. #138
Conversation
""" | ||
self._replace_toolbar_icons() | ||
if self.figure.gca(): | ||
self.apply_napari_colorscheme(self.figure.gca()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the correct line, but I still don't quite have a perfect UX when switching the theme whilst the widgets are open...
Screen.Recording.2023-05-31.at.16.51.00.mov
Re-opening or doing something to the plot seems to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of a dive into the napari
source, and you might want to use something like this line to trigger something when the theme is changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😞
napari.settings.get_settings().appearance.events.theme.connect(
self._on_theme_change
)
gives the same behaviour. I wonder if it might be a different way to do the same thing as
self.viewer.events.theme.connect(self._on_theme_change)
The theme-change event is undocumented* (scroll a bit from the start of § Viewer events) so I'd be up for asking and/or fixing the docs for napari.
*) It's also duplicated: that page is made via a script in napari/docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could switching the theme whilst widgets are open be something to do with the napari bug I raised
I think not. Although something missing in the callbacks for a widget being loaded .... maybe. |
Also needs a note in the changelog.
|
Since we're now setting the axes to off-white.
276d6ac
to
d5c05c6
Compare
Err if this is ok to merge, I think it needs a reapproval. I pushed a release note and updated the pytest-mpl plots. Sorry for the noise. |
Happy to merge this (once I've checked the code), but things that need issues opening to be fixed after this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, but overall looking 👍
Yeah. There are a few minor peripheral things that I noticed too...
Are you ok with 3 individual minor issues? |
Yep, three issues sounds good |
Change the text, axes, and icon colour to contrast with the background. I hear white text on an off-white background is not ideal.
Solves
Testing:
viewer.events.theme
callback is currently only tested manually. It works better than the currentmain
but is still not perfect. (I'm going to try and make a gif to show what I mean.)Note for reviewer(s):
theme.text
andtheme.foreground
.napari.Viewer
gets moved up the family tree and becomes a member of theBaseNapariMPLWidget
.